package service.api;


import com.distribute.pojo.enums.*;
import com.distribute.pojo.workflow.WorkflowDefinition;
import com.distribute.pojo.workflow.WorkflowScheduler;
import com.distribute.pojo.workflow.WorkflowExecutionTypeEnum;

import java.util.List;
import java.util.Map;

public interface WorkflowService extends Service{

    Boolean verifyWorkflowName(Long projectCode, String name);

    WorkflowDefinition getWorkflowDefinition(Long projectCode, String searchVal);

    WorkflowDefinition createWorkflowDefinition(Long projectCode, String taskDefinitionJson, String taskRelationJson,
                                                String locations, String name, String tenantCode, WorkflowExecutionTypeEnum executionType,
                                                String description, Object globalParams, Integer timeout, ReleaseState releaseState);


    Boolean updateWorkflowStatus(Long projectCode,String name,ReleaseState releaseState);

    WorkflowScheduler createWorkflowScheduler(Long projectCode, String schedule, FailureStrategy failureStrategy, WarningType warningType,
                                              Priority processInstancePriority, int warningGroupId, String workerGroup, int environmentCode,
                                              Long processDefinitionCode);

    Boolean startWorkflowInstance(Long projectCode, Long processDefinitionCode, FailureStrategy failureStrategy, WarningType warningType,
                                  Integer warningGroupId, CommandType execType, List startNodeList, TaskDependType taskDependType,
                                  ComplementDependentMode complementDependentMode, RunMode runMode, Priority processInstancePriority,
                                  String workerGroup, int environmentCode, Map<String, Object> startParams,int expectedParallelismNumber,
                                  int dryRun,String scheduleTime);

}
